<template>
  <!-- <HeaderBar></HeaderBar> -->
  <div class="my-content">
    <div>
      <span>我的首页</span>
    </div>
    <div>token:<el-input v-model="token"></el-input></div>
    <div>
      <el-button @click="saveToken">save</el-button>
      <el-button @click="loadToken">load</el-button>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import HeaderBar from '@/components/HeaderBar.vue';

const token = ref('');

function saveToken(params) {
  localStorage.setItem('my_token', token.value);
  ElMessage.success('保存成功');
}
function loadToken(params) {
  const aaa = localStorage.getItem('my_token');
  token.value = aaa;
}
onMounted(() => {
  loadToken();
});
</script>

<style scoped>
.my-content {
  padding: 12px;
}
</style>

